import store from '../store/index'
import router from './index'
router.beforeEach((to, from, next) => {
  // console.log('------',to);
  if (to.matched.some(record => record.meta.isLogin)) {
    let token =store.state.loginModule.userInfo.token;
    if (token) {
      next();
    } else {
      next('/login');
    }
  } else {
    next();
  }
});